<!DOCTYPE html>
<html lang="zh-hans">
<head>
    <meta charset="UTF-8">
    <title>发布商品</title>

    <script src="js/jquery-3.4.1.min.js"></script>
    <script src="common.js"></script>

    <link rel="stylesheet" href="css/bootstrap.min.css">
    <link rel="stylesheet" href="css/style.css">

    <script>
        window.onload = checkLog;
    </script>
</head>
<body>

<nav class="navbar navbar-expand-lg navbar-light bg-light title">
    <a class="navbar-brand title">二手交易平台</a>
    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
    </button>
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
        <ul class="navbar-nav mr-auto">
            <li class="nav-item headline">
                <a class="nav-link" href="index.html">待售商品</a>
            </li>
            <li class="nav-item headline">
                <a class="nav-link" href="needs.html">需求商品</a>
            </li>
            <li class="nav-item headline-current">
                <a class="nav-link" href="sg_publish.html">发布商品</a>
            </li>
            <li class="nav-item headline">
                <a class="nav-link" href="wg_publish.html">发布需求</a>
            </li>
            <li class="nav-item headline">
                <a class="nav-link" href="personal.html">个人中心</a>
            </li>
            <li class="nav-item headline">
                <a class="nav-link" href="login.html" id="logstatus">登录/注册</a>
            </li>
        </ul>
    </div>
</nav>
<div class="py-5 text-center">
    <h2>欲售物品发布</h2>
    <p class="lead">请填写您想出售的物品信息</p>
</div>

<div class="pg-main">
    
    <br>
        <div>
            <img src="images/upload.png" id="showImg" style="margin-left: 450px;margin-top: 50px;width: 200px;height: 200px">
        </div>
            
        <div>
            <input type="file" name="image" id="image" style="margin-left: 450px;margin-top: 50px;">
            <script>
                var input = document.getElementById("image");
                input.addEventListener('change', readFile, false);
            </script>
        </div>

        <div class="row">
            <div class="col-md-8 order-md-1">
                <form id="sgedit" class="needs-validation" novalidate>

                    
                    <div class="mb-3">
                        <label for="SG_name" style="margin-left: 300px;margin-top: 50px;">物品名</label>
                        <input type="text" name="SG_name" id="SG_name" style="width: 500px;height: 40px;margin-left: 300px" required>
                    </div>

                    <div class="mb-3">
                        <label for="SG_info" style="margin-left: 300px">物品描述</label>
                        <div class="input-group">
                            <textarea name="SG_info" id="SG_info" style="width: 500px;height: 120px;margin-left: 300px"></textarea>
                        </div>
                    </div>
                    

                    <div class="mb-3">
                        <label for="SG_price" style="margin-left: 300px">物品价格</label>
                        <input type="text" name="SG_price" id="SG_price" style="width: 500px;height: 40px;margin-left: 300px" required>
                    </div>
                    

                    <div class="mb-3">
                        <label for="SG_type" style="margin-left: 300px">物品类别</label>
                        <select name="SG_type" id="SG_type" style="width: 500px;height: 40px;margin-left: 300px" required>
                            <option value="">请选择...</option>
                            <option value="1">食品饮品</option>
                            <option value="2">书籍</option>
                            <option value="3">电子产品</option>
                            <option value="4">服饰</option>
                            <option value="5">化妆品</option>
                            <option value="6">运动器材</option>
                            <option value="7">日用品</option>
                            <option value="8">账号</option>
                            <option value="9">其他</option>
                        </select>
                    </div>
                    
                </form>

                <button class="btn btn-primary btn-lg btn-block" style="width: 500px;margin-top: 30px;margin-left: 300px" onclick="sg_publish()">发布</button>

            </div>
        </div>
    <br>
</div>
</body>
</html>